import { _ as _export_sfc, z as ref, al as useNavbarHeight, B as onLoad, A as computed, g as createElementBlock, b as createVNode, w as withCtx, n as normalizeStyle, H as unref, F as Fragment, j as resolveEasycom, i as index$g, G as __easycom_0, k as resolveDynamicComponent, o as openBlock, as as index$h, f as normalizeClass, t as createTextVNode, u as toDisplayString, h as renderList, c as createBlock, Q as index$x, a1 as navigateTo, ag as navigateBack } from './index-Cc4oxzDN.js';
import { b as __easycom_5 } from './uv-toast.nS_Liirv.js';
import './uv-loading-icon.DuNkB54M.js';

const _sfc_main = {
  __name: 'remark',
  setup(__props) {

const remark = ref('');
const quickInputs = ref( ['请放门把手上', '请放门口', '请放前台桌上', '如地址封闭管理，请电话与我联系']);
const uToast = ref();

// 获取导航栏高度
const { navbarHeightCss } = useNavbarHeight();

	// 返回上一页
	const $onClickLeft = () => {
		navigateBack();
	};
	
onLoad((opt) => {
	remark.value = opt.remark;
});	

const remarkLength = computed(() => { 
	return remark.value.length
});
computed(() => { 
	return remark.value.length > 50
});

const handleQuickInput = (item) => {
	remark.value = remark.value.concat(" ", item);
};
const submit = () => {
	if (remark.value.length > 50) {
		uToast.value.show({
			message: '不能超过50个字符',
			type: 'error'
		});
		return
	}
	navigateTo({
		url: "/pages/components/pages/pay/pay?remark=" + remark.value
	});
};
	


return (_ctx, _cache) => {
  const _component_uv_navbar = resolveEasycom(resolveDynamicComponent("uv-navbar"), __easycom_0);
  const _component_v_uni_textarea = index$h;
  const _component_v_uni_view = index$g;
  const _component_v_uni_button = index$x;
  const _component_uv_toast = resolveEasycom(resolveDynamicComponent("uv-toast"), __easycom_5);

  return (openBlock(), createElementBlock(Fragment, null, [
    createVNode(_component_uv_navbar, {
      fixed: true,
      title: _ctx.title,
      "left-arrow": "",
      onLeftClick: $onClickLeft
    }, null, 8, ["title"]),
    createVNode(_component_v_uni_view, {
      class: "container w-100 h-100 overflow-hidden",
      style: normalizeStyle(`padding-top: ${unref(navbarHeightCss)};`)
    }, {
      default: withCtx(() => [
        createVNode(_component_v_uni_view, { class: "textarea" }, {
          default: withCtx(() => [
            createVNode(_component_v_uni_textarea, {
              "placeholder-class": "text-color-assist font-size-base",
              modelValue: remark.value,
              "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((remark).value = $event)),
              class: normalizeClass(["bg-white w-100 border-box font-size-base remark", {'text-color-danger': remarkLength.value > 50, 'text-color-assist' : remarkLength.value <=50}]),
              placeholder: "请填写备注信息",
              focus: ""
            }, null, 8, ["modelValue", "class"]),
            createVNode(_component_v_uni_view, {
              class: normalizeClass(["tips", {'text-color-danger': remarkLength.value > 50, 'text-color-assist' : remarkLength.value <=50}])
            }, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(remarkLength.value) + "/50 ", 1)
              ]),
              _: 1
            }, 8, ["class"])
          ]),
          _: 1
        }),
        createVNode(_component_v_uni_view, {
          class: "d-flex font-size-base text-color-assist",
          style: {"margin":"40rpx 0"}
        }, {
          default: withCtx(() => [
            createTextVNode(" 快捷输入 ")
          ]),
          _: 1
        }),
        createVNode(_component_v_uni_view, { class: "quick-inputs d-flex flex-wrap justify-content-start" }, {
          default: withCtx(() => [
            (openBlock(true), createElementBlock(Fragment, null, renderList(quickInputs.value, (item, index) => {
              return (openBlock(), createBlock(_component_v_uni_view, {
                class: "quick-input",
                key: index,
                onClick: $event => (handleQuickInput(item))
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(item), 1)
                ]),
                _: 2
              }, 1032, ["onClick"]))
            }), 128))
          ]),
          _: 1
        }),
        createVNode(_component_v_uni_view, {
          class: "d-flex just-content-center align-items-center",
          style: {"margin-top":"60rpx"}
        }, {
          default: withCtx(() => [
            createVNode(_component_v_uni_button, {
              type: "primary",
              class: "submit-btn font-size-base",
              onClick: submit
            }, {
              default: withCtx(() => [
                createTextVNode("完成")
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        createVNode(_component_uv_toast, {
          ref_key: "uToast",
          ref: uToast
        }, null, 512)
      ]),
      _: 1
    }, 8, ["style"])
  ], 64))
}
}

};
const remark = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-d39572f6"]]);

export { remark as default };
